<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>HTTP::Lite - Lightweight HTTP implementation - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of HTTP-Lite - MetaCPAN" href="https://metacpan.org/dist/HTTP-Lite/releases.rss" />
        <link rel="canonical" href="./HTTP::Lite.html" />
        <meta name="description" content="Lightweight HTTP implementation" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/HTTP::Lite" />
<meta name="twitter:title"       content="HTTP::Lite" />
<meta name="twitter:description" content="Lightweight HTTP implementation" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./HTTP::Lite.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of HTTP-Lite was released.">
      <span class="relatize">11 Mar 2015 22:16:55 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/HTTP-Lite">HTTP-Lite</a>
  </li>
  <li>
    Module version: 2.44
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/HTTP-Lite/source/lib/HTTP/Lite.pm">Source</a>
    (<a href="https://metacpan.org/dist/HTTP-Lite/source/lib/HTTP/Lite.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/HTTP-Lite/source/lib/HTTP">Browse</a>
    (<a href="https://metacpan.org/dist/HTTP-Lite/source/lib/HTTP?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/HTTP-Lite/changes">Changes</a>
    </li>
    <li>
      <a rel="noopener nofollow" class="nopopup" href="https://github.com/neilbowers/HTTP-Lite">Homepage</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/HTTP-Lite/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/neilbowers/HTTP-Lite">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=HTTP-Lite">Issues</a>
      (9)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=HTTP-Lite+2.44" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/H/HTTP-Lite.html?oncpan=1&amp;distmat=1&amp;version=2.44&amp;grade=2" style="color: #090">664</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/H/HTTP-Lite.html?oncpan=1&amp;distmat=1&amp;version=2.44&amp;grade=3" style="color: #900">1</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/H/HTTP-Lite.html?oncpan=1&amp;distmat=1&amp;version=2.44&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/NEILB/HTTP-Lite-2.44">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on HTTP-Lite who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/HTTP-Lite-2.44/index.html">9.80% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li>
      Perl: v5.5.0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/HTTP-Lite/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/N/NE/NEILB/HTTP-Lite-2.44.tar.gz">
      Download (<span itemprop="fileSize">281.07KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FNEILB%2FHTTP-Lite-2.44%2Flib%2FHTTP%2FLite.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/HTTP-Lite/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/HTTP-Lite/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:HTTP-Lite">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="HTTP-Lite">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/HTTP/Lite.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="NEILB/HTTP-Lite-2.44"
>2.44
  (NEILB on 2015-03-11)</option>
<option
  
  value="ADAMK/HTTP-Lite-2.3"
>2.3
  (ADAMK on 2010-12-14)</option>
<option
  
  value="ADAMK/HTTP-Lite-2.2"
>2.2
  (ADAMK on 2009-10-01)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.6"
>2.1.6
  (RHOOPER on 2004-01-21)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.5"
>2.1.5
  (RHOOPER on 2003-10-06)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.4"
>2.1.4
  (RHOOPER on 2003-02-20)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.3"
>2.1.3
  (RHOOPER on 2003-02-10)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.1"
>2.1.1
  (RHOOPER on 2002-06-13)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.0"
>2.1.0
  (RHOOPER on 2002-06-13)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.2"
>1.0.2
  (RHOOPER on 2002-06-12)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.5"
>0.2.5
  (RHOOPER on 2000-12-21)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.03"
>0.03
  (RHOOPER on 2000-09-09)</option>
<optgroup label="BackPAN">'
<option
  
  value="NEILB/HTTP-Lite-2.43"
>2.43
  (NEILB on 2014-01-29)</option>
<option
  
  value="NEILB/HTTP-Lite-2.42"
>2.42
  (NEILB on 2013-07-22)</option>
<option
  
  value="NEILB/HTTP-Lite-2.41"
>2.41
  (NEILB on 2013-07-20)</option>
<option
  
  value="NEILB/HTTP-Lite-2.4"
>2.4
  (NEILB on 2012-07-19)</option>
<option
  
  value="NEILB/HTTP-Lite-2.3_2"
>2.3_2 DEV
  (NEILB on 2012-07-18)</option>
<option
  
  value="NEILB/HTTP-Lite-2.3_1"
>2.3_1 DEV
  (NEILB on 2012-07-10)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.1"
>1.0.1
  (RHOOPER on 2002-06-12)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.0"
>1.0.0
  (RHOOPER on 2002-01-09)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.4"
>0.2.4
  (RHOOPER on 2000-11-02)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.1"
>0.2.1
  (RHOOPER on 2000-09-29)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.02"
>0.02
  (RHOOPER on 2000-09-04)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/NEILB/HTTP-Lite-2.44/diff/' + encodeURIComponent(this.value) + '/lib/HTTP/Lite.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="NEILB/HTTP-Lite-2.44"
>2.44
  (NEILB on 2015-03-11)</option>
<option
  
  value="ADAMK/HTTP-Lite-2.3"
>2.3
  (ADAMK on 2010-12-14)</option>
<option
  
  value="ADAMK/HTTP-Lite-2.2"
>2.2
  (ADAMK on 2009-10-01)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.6"
>2.1.6
  (RHOOPER on 2004-01-21)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.5"
>2.1.5
  (RHOOPER on 2003-10-06)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.4"
>2.1.4
  (RHOOPER on 2003-02-20)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.3"
>2.1.3
  (RHOOPER on 2003-02-10)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.1"
>2.1.1
  (RHOOPER on 2002-06-13)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.0"
>2.1.0
  (RHOOPER on 2002-06-13)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.2"
>1.0.2
  (RHOOPER on 2002-06-12)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.5"
>0.2.5
  (RHOOPER on 2000-12-21)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.03"
>0.03
  (RHOOPER on 2000-09-09)</option>
<optgroup label="BackPAN">'
<option
  
  value="NEILB/HTTP-Lite-2.43"
>2.43
  (NEILB on 2014-01-29)</option>
<option
  
  value="NEILB/HTTP-Lite-2.42"
>2.42
  (NEILB on 2013-07-22)</option>
<option
  
  value="NEILB/HTTP-Lite-2.41"
>2.41
  (NEILB on 2013-07-20)</option>
<option
  
  value="NEILB/HTTP-Lite-2.4"
>2.4
  (NEILB on 2012-07-19)</option>
<option
  
  value="NEILB/HTTP-Lite-2.3_2"
>2.3_2 DEV
  (NEILB on 2012-07-18)</option>
<option
  
  value="NEILB/HTTP-Lite-2.3_1"
>2.3_1 DEV
  (NEILB on 2012-07-10)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.1"
>1.0.1
  (RHOOPER on 2002-06-12)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.0"
>1.0.0
  (RHOOPER on 2002-01-09)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.4"
>0.2.4
  (RHOOPER on 2000-11-02)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.1"
>0.2.1
  (RHOOPER on 2000-09-29)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.02"
>0.02
  (RHOOPER on 2000-09-04)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Fcntl" title="Fcntl" class="ellipsis">Fcntl</a></li>
  <li><a href="https://metacpan.org/pod/Socket" title="Socket" class="ellipsis">Socket</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><a href="https://metacpan.org/pod/warnings" title="warnings" class="ellipsis">warnings</a></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/HTTP::Lite/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=HTTP%3A%3ALite">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=HTTP-Lite">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/NEILB/HTTP-Lite-2.44/view/lib/HTTP/Lite.pm">This version</a>
    </li>
    <li>
      <a href="./HTTP::Lite.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/AYOUNG"><img src="https://www.gravatar.com/avatar/8d1e4946c288fbe87d1e0394f3e41b24?d=identicon&amp;s=20" title="AYOUNG" alt="AYOUNG"></a>
<a class="display-all" href="https://metacpan.org/author/MARKSTOS"><img src="https://www.gravatar.com/avatar/795623cd5c352aafe2d8f3d3bdd712ce?d=identicon&amp;s=20" title="MARKSTOS" alt="MARKSTOS"></a>
<a class="display-all" href="https://metacpan.org/author/KEEDI"><img src="https://www.gravatar.com/avatar/95f905a7a4ccc573c711e9d264c0fde8?d=identicon&amp;s=20" title="KEEDI" alt="KEEDI"></a>
<a class="display-all" href="https://metacpan.org/author/ILUX"><img src="https://www.gravatar.com/avatar/1cd0eea5e6ca13346060bb9d2c1e286b?d=identicon&amp;s=20" title="ILUX" alt="ILUX"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/HTTP-Lite/plussers">4 PAUSE users</a>
</div>
<div>
    1 non-PAUSE user
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 1 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
      data-contrib-email="rhooper@thetoybox.org"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Roy Hooper
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/NEILB" class="author-name">Neil Bowers</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/HTTP/Lite.pm&#39;" class="">
<option
  selected
  value="NEILB/HTTP-Lite-2.44"
>2.44
  (NEILB on 2015-03-11)</option>
<option
  
  value="ADAMK/HTTP-Lite-2.3"
>2.3
  (ADAMK on 2010-12-14)</option>
<option
  
  value="ADAMK/HTTP-Lite-2.2"
>2.2
  (ADAMK on 2009-10-01)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.6"
>2.1.6
  (RHOOPER on 2004-01-21)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.5"
>2.1.5
  (RHOOPER on 2003-10-06)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.4"
>2.1.4
  (RHOOPER on 2003-02-20)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.3"
>2.1.3
  (RHOOPER on 2003-02-10)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.1"
>2.1.1
  (RHOOPER on 2002-06-13)</option>
<option
  
  value="RHOOPER/HTTP-Lite-2.1.0"
>2.1.0
  (RHOOPER on 2002-06-13)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.2"
>1.0.2
  (RHOOPER on 2002-06-12)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.5"
>0.2.5
  (RHOOPER on 2000-12-21)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.03"
>0.03
  (RHOOPER on 2000-09-09)</option>
<optgroup label="BackPAN">'
<option
  
  value="NEILB/HTTP-Lite-2.43"
>2.43
  (NEILB on 2014-01-29)</option>
<option
  
  value="NEILB/HTTP-Lite-2.42"
>2.42
  (NEILB on 2013-07-22)</option>
<option
  
  value="NEILB/HTTP-Lite-2.41"
>2.41
  (NEILB on 2013-07-20)</option>
<option
  
  value="NEILB/HTTP-Lite-2.4"
>2.4
  (NEILB on 2012-07-19)</option>
<option
  
  value="NEILB/HTTP-Lite-2.3_2"
>2.3_2 DEV
  (NEILB on 2012-07-18)</option>
<option
  
  value="NEILB/HTTP-Lite-2.3_1"
>2.3_1 DEV
  (NEILB on 2012-07-10)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.1"
>1.0.1
  (RHOOPER on 2002-06-12)</option>
<option
  
  value="RHOOPER/HTTP-Lite-1.0.0"
>1.0.0
  (RHOOPER on 2002-01-09)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.4"
>0.2.4
  (RHOOPER on 2000-11-02)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.2.1"
>0.2.1
  (RHOOPER on 2000-09-29)</option>
<option
  
  value="RHOOPER/HTTP-Lite-0.02"
>0.02
  (RHOOPER on 2000-09-04)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/HTTP-Lite">HTTP-Lite-2.44</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage two &#10;
          • 8 direct dependents &#10;          • 70 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="HTTP-Lite-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="HTTP-Lite-2.44">
    <input type="hidden" name="author" value="NEILB">
    <input type="hidden" name="distribution" value="HTTP-Lite">
    <button type="submit" class="favorite highlight"><span>5</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./HTTP::Lite.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>5</span> ++</a>
</div>
   / <span>HTTP::Lite</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./HTTP::Lite.html#NAME">NAME</a></li>
  <li><a href="./HTTP::Lite.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./HTTP::Lite.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./HTTP::Lite.html#CONSTRUCTOR">CONSTRUCTOR</a></li>
  <li><a href="./HTTP::Lite.html#METHODS">METHODS</a></li>
  <li><a href="./HTTP::Lite.html#EXAMPLES">EXAMPLES</a></li>
  <li><a href="./HTTP::Lite.html#UNIMPLEMENTED">UNIMPLEMENTED</a></li>
  <li><a href="./HTTP::Lite.html#BUGS">BUGS</a></li>
  <li><a href="./HTTP::Lite.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./HTTP::Lite.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./HTTP::Lite.html#COPYRIGHT">COPYRIGHT</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>HTTP::Lite - Lightweight HTTP implementation</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use HTTP::Lite;
    $http = HTTP::Lite-&gt;new;
    $req = $http-&gt;request(&quot;http://www.cpan.org/&quot;) 
        or die &quot;Unable to get document: $!&quot;;
    print $http-&gt;body();</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p><b>Note:</b> you should look at <a href="https://metacpan.org/pod/HTTP::Tiny">HTTP::Tiny</a> or <a href="LWP.html">LWP</a> before using this module.</p>

<p>HTTP::Lite is a stand-alone lightweight HTTP/1.1 implementation for perl. It is not intended as a replacement for the fully-featured LWP module. Instead, it is intended for use in situations where it is desirable to install the minimal number of modules to achieve HTTP support, or where LWP is not a good candidate due to CPU overhead, such as slower processors. HTTP::Lite is also significantly faster than LWP.</p>

<p>HTTP::Lite is ideal for CGI (or mod_perl) programs or for bundling for redistribution with larger packages where only HTTP GET and POST functionality are necessary.</p>

<p>HTTP::Lite supports basic POST and GET operations only. As of 0.2.1, HTTP::Lite supports HTTP/1.1 and is compliant with the Host header, necessary for name based virtual hosting. Additionally, HTTP::Lite now supports Proxies.</p>

<p>As of 2.0.0 HTTP::Lite now supports a callback to allow processing of request data as it arrives. This is useful for handling very large files without consuming memory.</p>

<p>If you require more functionality, such as FTP or HTTPS, please see libwwwperl (LWP). LWP is a significantly better and more comprehensive package than HTTP::Lite, and should be used instead of HTTP::Lite whenever possible.</p>

<h1 id="CONSTRUCTOR">CONSTRUCTOR</h1>

<dl>

<dt id="new">new</dt>
<dd>

<p>This is the constructor for HTTP::Lite. It presently takes no arguments. A future version of HTTP::Lite might accept parameters.</p>

</dd>
</dl>

<h1 id="METHODS">METHODS</h1>

<dl>

<dt id="request-(-$url,-$data_callback,-$cbargs-)"><a id="request"></a><a id="request----url---data_callback---cbargs"></a>request ( $url, $data_callback, $cbargs )</dt>
<dd>

<p>Initiates a request to the specified URL.</p>

<p>Returns undef if an I/O error is encountered, otherwise the HTTP status code will be returned. 200 series status codes represent success, 300 represent temporary errors, 400 represent permanent errors, and 500 represent server errors.</p>

<p>See <i>http://www.w3.org/Protocols/HTTP/HTRESP.html</i> for detailed information about HTTP status codes.</p>

<p>The $data_callback parameter, if used, is a way to filter the data as it is received or to handle large transfers. It must be a function reference, and will be passed: a reference to the instance of the http request making the callback, a reference to the current block of data about to be added to the body, and the $cbargs parameter (which may be anything). It must return either a reference to the data to add to the body of the document, or undef.</p>

<p>If set_callback is used, $data_callback and $cbargs are not used. $cbargs may be either a scalar or a reference.</p>

<p>The data_callback is called as: &amp;$data_callback( $self, $dataref, $cbargs )</p>

<p>An example use to save a document to file is:</p>

<pre><code>  # Write the data to the filehandle $cbargs
  sub savetofile {
    my ($self,$phase,$dataref,$cbargs) = @_;
    print $cbargs $$dataref;
    return undef;
  }

  $url = &quot;$testpath/bigbinary.dat&quot;;
  open OUT, &#39;&gt;&#39;,&#39;bigbinary.dat&#39;;
  $res = $http-&gt;request($url, \&amp;savetofile, OUT);
  close OUT;</code></pre>

</dd>
<dt id="set_callback-(-$functionref,-$dataref-)"><a id="set_callback"></a><a id="set_callback----functionref---dataref"></a>set_callback ( $functionref, $dataref )</dt>
<dd>

<p>At various stages of the request, callbacks may be used to modify the behaviour or to monitor the status of the request. These work like the $data_callback parameter to request(), but are more versatile. Using set_callback disables $data_callback in request()</p>

<p>The callbacks are called as: callback ( $self, $phase, $dataref, $cbargs )</p>

<p>The current phases are:</p>

<pre><code>  connect - connection has been established and headers are being
            transmitted.

  content-length - return value is used as the content-length.  If undef,
            and prepare_post() was used, the content length is
            calculated.

  done-headers - all headers have been sent

  content - return value is used as content and is sent to client.  Return
            undef to use the internal content defined by prepare_post().

  content-done - content has been successfuly transmitted.

  data - A block of data has been received.  The data is referenced by
            $dataref.  The return value is dereferenced and replaces the
            content passed in.  Return undef to avoid using memory for large
            documents.

  done - Request is done.</code></pre>

</dd>
<dt id="prepare_post-(-$hashref-)"><a id="prepare_post"></a><a id="prepare_post----hashref"></a>prepare_post ( $hashref )</dt>
<dd>

<p>Takes a reference to a hashed array of post form variables to upload. Create the HTTP body and sets the method to POST.</p>

</dd>
<dt id="http11_mode-(-0-|-1-)"><a id="http11_mode"></a><a id="http11_mode---0---1"></a>http11_mode ( 0 | 1 )</dt>
<dd>

<p>Turns on or off HTTP/1.1 support. This is off by default due to broken HTTP/1.1 servers. Use 1 to enable HTTP/1.1 support.</p>

</dd>
<dt id="add_req_header-(-$header,-$value-)"><a id="add_req_header"></a><a id="add_req_header----header---value"></a>add_req_header ( $header, $value )</dt>
<dd>

</dd>
<dt id="get_req_header-(-$header-)"><a id="get_req_header"></a><a id="get_req_header----header"></a>get_req_header ( $header )</dt>
<dd>

</dd>
<dt id="delete_req_header-(-$header-)"><a id="delete_req_header"></a><a id="delete_req_header----header"></a>delete_req_header ( $header )</dt>
<dd>

<p>Add, Delete, or get a HTTP header(s) for the request. These functions allow you to override any header. Presently, Host, User-Agent, Content-Type, Accept, and Connection are pre-defined by the HTTP::Lite module. You may not override Host, Connection, or Accept.</p>

<p>If you call <code>add_req_header()</code> with <code>$value</code> set to <code>undef</code>, then the header won&#39;t be added.</p>

<p>To provide (proxy) authentication or authorization, you would use:</p>

<pre><code>    use HTTP::Lite;
    use MIME::Base64;
    $http = HTTP::Lite-&gt;new;
    $encoded = encode_base64(&#39;username:password&#39;);
    $http-&gt;add_req_header(&quot;Authorization&quot;, $encoded);</code></pre>

<p><b>NOTE</b>: The present implementation limits you to one instance of each header.</p>

</dd>
<dt id="body">body</dt>
<dd>

<p>Returns the body of the document returned by the remote server.</p>

</dd>
<dt id="headers_array">headers_array</dt>
<dd>

<p>Returns an array of the HTTP headers returned by the remote server.</p>

</dd>
<dt id="headers_string">headers_string</dt>
<dd>

<p>Returns a string representation of the HTTP headers returned by the remote server.</p>

</dd>
<dt id="get_header-(-$header-)"><a id="get_header"></a><a id="get_header----header"></a>get_header ( $header )</dt>
<dd>

<p>Returns an array of values for the requested header.</p>

<p><b>NOTE</b>: HTTP requests are not limited to a single instance of each header. As a result, there may be more than one entry for every header.</p>

</dd>
<dt id="protocol">protocol</dt>
<dd>

<p>Returns the HTTP protocol identifier, as reported by the remote server. This will generally be either HTTP/1.0 or HTTP/1.1.</p>

</dd>
<dt id="proxy-(-$proxy_server-)"><a id="proxy"></a><a id="proxy----proxy_server"></a>proxy ( $proxy_server )</dt>
<dd>

<p>The URL or hostname of the proxy to use for the next request.</p>

</dd>
<dt id="status">status</dt>
<dd>

<p>Returns the HTTP status code returned by the server. This is also reported as the return value of <i>request()</i>.</p>

</dd>
<dt id="status_message">status_message</dt>
<dd>

<p>Returns the textual description of the status code as returned by the server. The status string is not required to adhere to any particular format, although most HTTP servers use a standard set of descriptions.</p>

</dd>
<dt id="reset">reset</dt>
<dd>

<p>You must call this prior to re-using an HTTP::Lite handle, otherwise the results are undefined.</p>

</dd>
<dt id="local_addr-(-$ip-)"><a id="local_addr"></a><a id="local_addr----ip"></a>local_addr ( $ip )</dt>
<dd>

<p>Explicity select the local IP address. 0.0.0.0 (default) lets the system choose.</p>

</dd>
<dt id="local_port-(-$port-)"><a id="local_port"></a><a id="local_port----port"></a>local_port ( $port )</dt>
<dd>

<p>Explicity select the local port. 0 (default and recommended) lets the system choose.</p>

</dd>
<dt id="method-(-$method-)"><a id="method"></a><a id="method----method"></a>method ( $method )</dt>
<dd>

<p>Explicity set the method. Using prepare_post or reset overrides this setting. Usual choices are GET, POST, PUT, HEAD</p>

</dd>
</dl>

<h1 id="EXAMPLES">EXAMPLES</h1>

<pre><code>    # Get and print out the headers and body of the CPAN homepage
    use HTTP::Lite;
    $http = HTTP::Lite-&gt;new;
    $req = $http-&gt;request(&quot;http://www.cpan.org/&quot;)
        or die &quot;Unable to get document: $!&quot;;
    die &quot;Request failed ($req): &quot;.$http-&gt;status_message()
      if $req ne &quot;200&quot;;
    @headers = $http-&gt;headers_array();
    $body = $http-&gt;body();
    foreach $header (@headers)
    {
      print &quot;$header$CRLF&quot;;
    }
    print &quot;$CRLF&quot;;
    print &quot;$body$CRLF&quot;;

    # POST a query to the dejanews USENET search engine
    use HTTP::Lite;
    $http = HTTP::Lite-&gt;new;
    %vars = (
             &quot;QRY&quot; =&gt; &quot;perl&quot;,
             &quot;ST&quot; =&gt; &quot;MS&quot;,
             &quot;svcclass&quot; =&gt; &quot;dncurrent&quot;,
             &quot;DBS&quot; =&gt; &quot;2&quot;
            );
    $http-&gt;prepare_post(\%vars);
    $req = $http-&gt;request(&quot;http://www.deja.com/dnquery.xp&quot;)
      or die &quot;Unable to get document: $!&quot;;
    print &quot;req: $req\n&quot;;
    print $http-&gt;body();</code></pre>

<h1 id="UNIMPLEMENTED">UNIMPLEMENTED</h1>

<pre><code>    - FTP 
    - HTTPS (SSL)
    - Authenitcation/Authorizaton/Proxy-Authorization
      are not directly supported, and require MIME::Base64.
    - Redirects (Location) are not automatically followed
    - multipart/form-data POSTs are not directly supported (necessary
      for File uploads).</code></pre>

<h1 id="BUGS">BUGS</h1>

<p>Some broken HTTP/1.1 servers send incorrect chunk sizes when transferring files. HTTP/1.1 mode is now disabled by default.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Roy Hooper &lt;rhooper@thetoybox.org&gt;</p>

<p>Now co-maintained by Neil Bowers &lt;neilb@cpan.org&gt;.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p>This module (HTTP::Lite) is almost certainly not the best module for your needs.</p>

<p>For most uses <a href="https://metacpan.org/pod/HTTP::Tiny">HTTP::Tiny</a> is a good choice. If you need more features, then look at <a href="LWP.html">LWP</a>.</p>

<p>You could also read this <a href="http://neilb.org/reviews/http-requesters.html">review of CPAN modules for making HTTP requests</a>.</p>

<h1 id="COPYRIGHT">COPYRIGHT</h1>

<p>Copyright (c) 2000-2002 Roy Hooper. All rights reserved.</p>

<p>Some parts copyright 2009 - 2010 Adam Kennedy.</p>

<p>This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install HTTP::Lite, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm HTTP::Lite</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install HTTP::Lite</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./HTTP::Lite.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
